package com.hnkywl.sts.service.xsgl;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hnkywl.sts.dao.xsgl.JfmxDao;
import com.hnkywl.sts.dao.xsgl.XsdDao;
import com.hnkywl.sts.entity.sfgl.Sfk;
import com.hnkywl.sts.entity.xsgl.Jfmx;
import com.hnkywl.sts.util.BaseUtils;
import net.ruixin.orm.hibernate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by HL on 2015/9/8.
 */
@Service
public class JfmxService {
    private JfmxDao jfmxDao;

    @Transactional
    public String findJfmxList(int pageNo, int pageSize) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        Page<Map> page = this.jfmxDao.findJfmxList(null, null, null, null, null, pageNo, pageSize);
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    @Autowired
    public void setJfmxDao(JfmxDao jfmxDao) {
        this.jfmxDao = jfmxDao;
    }

}
